package cn.edu.wyu.blogmvc;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/timeline")
public class TimelineController {
    @Autowired
    PostDAOMock postDAOMock;

    @GetMapping("/my")
    public ModelAndView my(){
        ModelAndView mv=new ModelAndView();
        mv.setViewName("timeline");
        mv.addObject("posts",postDAOMock.list());
        return mv;
    }

}
